﻿@using GMS.Framework.Contract
@using GMS.Framework.Web.Controls
@using GMS.Cms.Contract
@using GMS.Web
@model Channel
@{
    Layout = "~/Views/Shared/_Layout.Edit.cshtml";
}
@section PageSpecificStyleSheetIncludes{
}
@section PageSpecificJavascriptIncludes{
    <script type="text/javascript" src="@Url.StaticFile("/content/scripts/flashupload.js")"></script>
    <script type="text/javascript">
        $('#uploader').FileUpload({
            'subfolder': 'cms',
            'callback': function (msg) {
                //msg.url为图片地址
                $("#CoverPicture").val(msg.url);
                $("#preview").popover({ trigger: 'hover', html: true, placement: 'right ', content: "<img src='" + getThumbAbsoluteUrl(msg.url) + "'/>" });
            }
        });

        if ($("#CoverPicture").val()) {
            $("#preview").popover({ trigger: 'hover', html: true, placement: 'right ', content: "<img src='" + getThumbAbsoluteUrl($("#CoverPicture").val()) + "'/>" });
        } 
   </script>
}
@section MainContent{
<div class="portlet-body form-horizontal form-bordered form-row-stripped">
    <div class="row-fluid"> 
            <div class="control-group">
                <label class="control-label"><span class="required">*</span>名称：</label>
                <div class="controls">
                @Html.TextBoxFor(m => m.Name, new { @class = "m-wrap" })
                <span class="help-inline">@Html.ValidationMessageFor(m => m.Name)</span>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">描述：</label>
                <div class="controls">
                @Html.TextBoxFor(m => m.Desc, new { @class = "m-wrap large" })
                <span class="help-inline">@Html.ValidationMessageFor(m => m.Desc)</span>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">封面图片：</label>
                <div class="controls">
                    <div class="input-append">
                        @Html.TextBoxFor(m => m.CoverPicture, new { @class = "m-wrap large" })
                        <span class="add-on" title="预览" id="preview"><i class="icon-picture"></i></span>
                    </div>
                    <div id="uploader"></div>
                    <div id="fileQueue"></div>
                    <span class="help-inline">@Html.ValidationMessageFor(m => m.CoverPicture)</span>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">是否激活：</label>
                <div class="controls">
                @Html.CheckBoxFor(m => m.IsActive)
                </div>
            </div>
            
    </div>
</div>
}

